<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <select>
        <option value="bing">Bing</option>
        <option value="google">Google</option>
        <option value="baidu">Baidu</option>
    </select>
    <a href="http://www.bing.com">点击搜索</a>
    <script>
        var select = document.querySelector('select');
        var link = document.querySelector('a');
        var urls = {
            baidu:'http://baidu.com',
            google:'http://google.com',
            bing:'http://bing.com',
        }
        select.onchange = function () {
            // 方法一：
            // link.href = select.value;
            // 方法二：
            // switch (select.value) {
            //     case 'bing':
            //         link.href = "http://www.bing.com";
            //         break;
            // }
            // if (select.value == 'google') {
            //     link.href = "http://www.google.com";
            // }
            // 方法三:
            link.url = urls[select.value]; 
        }
    </script>
</body>

</html>